
// shopMallPackage/pages/richDetailPage/richDetailPage.js
import { queryHomeRichDetail } from "../../../service/onetoone_service"
Page({

  /**
   * 页面的初始数据
   */
  data: {
    detailId: '',
    title: "详情",
    richContent: {},
    isBottom:0,
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.setData({
      detailId: options.id,
      title: options.title || '详情',
      isBottom: options.isBottom
    })
    wx.setNavigationBarTitle({
      title: this.data.title,
    })
    this.queryHomeRichDetail();
  },

  queryHomeRichDetail() {
    wx.showLoading()
    let state = false;
    if(this.data.isBottom == 1){
      state = true;
    }
    queryHomeRichDetail(this.data.detailId,state).then(res => {
      wx.hideLoading();
      console.log("JJLog:详情是:" + JSON.stringify(res));
      if (res.code == 200) {
        this.setData({
          richContent:res.data
        })
      }
    }).catch(err => {
      wx.hideLoading();
      wx.showToast({
        title: err || '查询失败',
      })
    })
  },




})